<!doctype html>

<html>
  <head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <meta name='gwt:property' content='locale=en'>

    <title>Yui4Gwt example gallery</title>
    
    <script type="text/javascript" language="javascript" 
    	src="http://yui.yahooapis.com/3.5.1/build/yui/yui-min.js"></script>
    	
<!--     <link rel="stylesheet" type="text/css"  -->
<!--     href="http://yui.yahooapis.com/combo?3.3.0/build/cssfonts/fonts-min.css&3.3.0/build/cssreset/reset-min.css&3.3.0/build/cssbase/base-min.css"> -->
    
<!-- <script src="http://yui.yahooapis.com/3.3.0/build/yui/yui-min.js"  -->
<!-- type="text/javascript"></script>    	 -->
    	
    	
<!--     	 <script type="text/javascript" src="http://yui.yahooapis.com/3.3.0/build/yui/yui-min.js"></script> -->
<!--     <script type="text/javascript" src="../../../build/gallery-form/gallery-form.js"></script> -->
    
    
  </head>
  <body class="yui3-skin-sam">
  <div id="form"></div>
  
  
<!-- <script src="http://yui.yahooapis.com/3.3.0/build/yui/yui-min.js" type="text/javascript"></script> -->

<!-- <script src="http://www.greghinch.com/examples/form/gallery-form-min.js" type="text/javascript"></script> -->



<!-- <script type="text/javascript"> 
//     YUI({
//         modules : {
//             'gallery-form' : {
//                 fullpath: 'gallery-form-min.js',
//                 requires: ['node', 'widget', 'widget-parent', 'widget-child', 'io-form', 'base-build']
//             }
//         }
//     }).use('gallery-form', function (Y) {
//         var myForm = new Y.Form({
//             method : "post",
//             action : "/test.php?action=submit",
//             inlineValidation : true,
//             children : [
//                 {name : 'input1', type : 'text', label : 'Email Input: ', validator : 'email'},
//                 {name : 'input2', type : 'text', label : 'Phone Number Input: ', validator : 'phone'},
//                 {name : 'choiceinput', type : 'ChoiceField', label : 'Radio Choices: ', choices : [
//                     {label : 'Choice A', value : 'A'},
//                     {label : 'Choice B', value : 'B'},
//                     {label : 'Choice C', value : 'C'}
//                 ]},
//                 {type : 'SubmitButton', value : 'Submit'},
//                 {type : 'ResetButton', value : 'Reset'}
//             ]
//         });
//         myForm.render('#formContainer');
//     });
</script> -->

<script type="text/javascript">
YUI({
    //Last Gallery Build of this module
    gallery: 'gallery-2011.11.10-16-24'
}).use("gallery-form", function (Y) {
    // Create a Field Object manually
    var myField = new Y.CheckboxField({
        name : "myCheckbox",
        value : "check",
        label : "Test Checkbox"
    });
 
    alert(Y.FormField.INVALID_DATE_MESSAGE+" - "+Y.CheckboxField.INVALID_DATE_MESSAGE); 
    
    var f = new Y.Form({
        boundingBox: '#form',
        action : 'test.php',
        method : 'post',
        children : [
            myField,
            // Have the Form class create your fields itself
            {name : "testText", required : true, label : "Test Label"},
            {name : 'testHiddenField', type : "HiddenField"},
            {name : 'testSelectField', type : 'SelectField', choices : [{label : 'Foo', value : 'foo'}, {label : 'Bar', value : 'bar'}], label : 'testSelect'},
            {name : 'submitBtn', type : 'SubmitButton', value : 'Submit'},
            {name : 'resetBtn', type : 'ResetButton', value : 'Reset'}
        ]
    });
 
    f.subscribe('success', function (args) {
        alert ('Form submission successful');
    });
    f.subscribe('failure', function (args) {
        alert('Form submission failed');
    });
 
    f.render();
});
</script>

  </body>
</html>
